package com.topvision.service.impl;

import com.topvision.domain.SysProduct;
import com.topvision.repository.SysProductRepository;
import com.topvision.service.SysProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class SysProductServiceImpl implements SysProductService{

    @Autowired
    private SysProductRepository sysProductRepository;
    @Override
    public Optional<List<SysProduct>> findByParentId(Long parentId) {


        return sysProductRepository.findByParentId(parentId);

    }

    @Override
    public SysProduct findone(Long id) {
        return sysProductRepository.findOne(id);
    }
}
